smalltalk.addPackage('Easnoth-Core', {});
smalltalk.addClass('Cell', smalltalk.Object, ['drawedObjects', 'x', 'y'], 'Easnoth-Core');
smalltalk.addMethod(
"_draw",
smalltalk.method({
selector: "draw",
category: 'displaying',
fn: function () {
    var self = this;
    smalltalk.send(self['@drawedObjects'], "_do_", [function (drawedObject) {return ($receiver = drawedObject) != nil && $receiver != undefined ? function () {return smalltalk.send(drawedObject, "_drawX_y_", [smalltalk.send(self, "_x", []), smalltalk.send(self, "_y", [])]);}() : nil;}]);
    return self;
},
args: [],
source: "draw\x0a\x09drawedObjects do: [ :drawedObject |\x0a\x09\x09drawedObject ifNotNil: [drawedObject drawX: self x y: self y]].",
messageSends: ["do:", "ifNotNil:", "drawX:y:", "x", "y"],
referencedClasses: []
}),
smalltalk.Cell);

smalltalk.addMethod(
"_drawedObjects",
smalltalk.method({
selector: "drawedObjects",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@drawedObjects'];
    return self;
},
args: [],
source: "drawedObjects\x0a\x09^drawedObjects",
messageSends: [],
referencedClasses: []
}),
smalltalk.Cell);

smalltalk.addMethod(
"_drawedObjects_",
smalltalk.method({
selector: "drawedObjects:",
category: 'accessing',
fn: function (value) {
    var self = this;
    self['@drawedObjects'] = value;
    return self;
},
args: ["value"],
source: "drawedObjects: value\x0a\x09drawedObjects := value.",
messageSends: [],
referencedClasses: []
}),
smalltalk.Cell);

smalltalk.addMethod(
"_tile",
smalltalk.method({
selector: "tile",
category: 'accessing',
fn: function () {
    var self = this;
    return smalltalk.send(self['@drawedObjects'], "_at_", [1]);
    return self;
},
args: [],
source: "tile\x0a\x09^drawedObjects at: 1",
messageSends: ["at:"],
referencedClasses: []
}),
smalltalk.Cell);

smalltalk.addMethod(
"_tile_",
smalltalk.method({
selector: "tile:",
category: 'accessing',
fn: function (aTile) {
    var self = this;
    smalltalk.send(self['@drawedObjects'], "_at_put_", [1, aTile]);
    return self;
},
args: ["aTile"],
source: "tile: aTile\x0a\x09drawedObjects at: 1 put: aTile.",
messageSends: ["at:put:"],
referencedClasses: []
}),
smalltalk.Cell);

smalltalk.addMethod(
"_x",
smalltalk.method({
selector: "x",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@x'];
    return self;
},
args: [],
source: "x\x0a\x09^x",
messageSends: [],
referencedClasses: []
}),
smalltalk.Cell);

smalltalk.addMethod(
"_x_",
smalltalk.method({
selector: "x:",
category: 'accessing',
fn: function (value) {
    var self = this;
    self['@x'] = value;
    return self;
},
args: ["value"],
source: "x: value\x0a\x09x := value.",
messageSends: [],
referencedClasses: []
}),
smalltalk.Cell);

smalltalk.addMethod(
"_y",
smalltalk.method({
selector: "y",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@y'];
    return self;
},
args: [],
source: "y\x0a\x09^y",
messageSends: [],
referencedClasses: []
}),
smalltalk.Cell);

smalltalk.addMethod(
"_y_",
smalltalk.method({
selector: "y:",
category: 'accessing',
fn: function (value) {
    var self = this;
    self['@y'] = value;
    return self;
},
args: ["value"],
source: "y: value\x0a\x09y := value.",
messageSends: [],
referencedClasses: []
}),
smalltalk.Cell);


smalltalk.addMethod(
"_newWithContext_cellArray_coods_",
smalltalk.method({
selector: "newWithContext:cellArray:coods:",
category: 'instance creation',
fn: function (aContext, aCellArray, coods) {
    var self = this;
    return function ($rec) {smalltalk.send($rec, "_drawedObjects_", [smalltalk.send(smalltalk.Array || Array, "_new_", [8])]);smalltalk.send($rec, "_x_", [smalltalk.send(coods, "_at_", [1])]);smalltalk.send($rec, "_y_", [smalltalk.send(coods, "_at_", [2])]);smalltalk.send($rec, "_tile_", [smalltalk.send(smalltalk.Tile || Tile, "_newWithContext_index_", [aContext, smalltalk.send(aCellArray, "_at_", [1])])]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
    return self;
},
args: ["aContext", "aCellArray", "coods"],
source: "newWithContext: aContext cellArray: aCellArray coods: coods\x0a\x09^self new\x0a\x09\x09drawedObjects: (Array new: 8);\x0a\x09\x09x: (coods at: 1);\x0a\x09\x09y: (coods at: 2);\x0a\x09\x09tile: (Tile newWithContext: aContext index: (aCellArray at: 1));\x0a\x09\x09yourself.",
messageSends: ["drawedObjects:", "new:", "x:", "at:", "y:", "tile:", "newWithContext:index:", "yourself", "new"],
referencedClasses: ["Array", "Tile"]
}),
smalltalk.Cell.klass);


smalltalk.addClass('DrawedObject', smalltalk.Object, ['image', 'context'], 'Easnoth-Core');
smalltalk.addMethod(
"_context",
smalltalk.method({
selector: "context",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@context'];
    return self;
},
args: [],
source: "context\x0a\x09^context",
messageSends: [],
referencedClasses: []
}),
smalltalk.DrawedObject);

smalltalk.addMethod(
"_context_",
smalltalk.method({
selector: "context:",
category: 'accessing',
fn: function (aCtx) {
    var self = this;
    self['@context'] = aCtx;
    return self;
},
args: ["aCtx"],
source: "context: aCtx\x0a\x09context := aCtx",
messageSends: [],
referencedClasses: []
}),
smalltalk.DrawedObject);

smalltalk.addMethod(
"_displayX_y_",
smalltalk.method({
selector: "displayX:y:",
category: 'displaying',
fn: function (aX, aY) {
    var self = this;
    smalltalk.send(smalltalk.send(self, "_context", []), "_drawImage_x_y_", [smalltalk.send(self, "_image", []), aX, aY]);
    return self;
},
args: ["aX", "aY"],
source: "displayX: aX y: aY\x0a\x09self context drawImage: self image\x0a\x09\x09\x09\x09\x09\x09x: aX\x0a\x09\x09\x09\x09\x09\x09y: aY.",
messageSends: ["drawImage:x:y:", "context", "image"],
referencedClasses: []
}),
smalltalk.DrawedObject);

smalltalk.addMethod(
"_drawX_y_",
smalltalk.method({
selector: "drawX:y:",
category: 'displaying',
fn: function (aX, aY) {
    var self = this;
    smalltalk.send(self, "_subclassResponsibility", []);
    return self;
},
args: ["aX", "aY"],
source: "drawX: aX y: aY\x0a\x09self subclassResponsibility",
messageSends: ["subclassResponsibility"],
referencedClasses: []
}),
smalltalk.DrawedObject);

smalltalk.addMethod(
"_image",
smalltalk.method({
selector: "image",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@image'];
    return self;
},
args: [],
source: "image\x0a\x09^image",
messageSends: [],
referencedClasses: []
}),
smalltalk.DrawedObject);

smalltalk.addMethod(
"_image_",
smalltalk.method({
selector: "image:",
category: 'accessing',
fn: function (anImage) {
    var self = this;
    self['@image'] = anImage;
    return self;
},
args: ["anImage"],
source: "image: anImage\x0a\x09image := anImage",
messageSends: [],
referencedClasses: []
}),
smalltalk.DrawedObject);

smalltalk.addMethod(
"_initializeContext_index_",
smalltalk.method({
selector: "initializeContext:index:",
category: 'accessing',
fn: function (aCtx, anIndex) {
    var self = this;
    smalltalk.send(self, "_context_", [aCtx]);
    smalltalk.send(self, "_image_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_arrayImg", []), "_atIndex_", [anIndex])]);
    return self;
},
args: ["aCtx", "anIndex"],
source: "initializeContext: aCtx index: anIndex\x0a\x09self context: aCtx.\x0a\x09self image: (self class arrayImg atIndex: anIndex). \x22TODO use library\x22",
messageSends: ["context:", "image:", "atIndex:", "arrayImg", "class"],
referencedClasses: []
}),
smalltalk.DrawedObject);


smalltalk.DrawedObject.klass.iVarNames = ['arrayImg'];
smalltalk.addMethod(
"_arrayImg",
smalltalk.method({
selector: "arrayImg",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@arrayImg'];
    return self;
},
args: [],
source: "arrayImg\x0a\x09^arrayImg",
messageSends: [],
referencedClasses: []
}),
smalltalk.DrawedObject.klass);

smalltalk.addMethod(
"_arrayImg_",
smalltalk.method({
selector: "arrayImg:",
category: 'accessing',
fn: function (anArray) {
    var self = this;
    self['@arrayImg'] = anArray;
    return self;
},
args: ["anArray"],
source: "arrayImg: anArray\x0a\x09arrayImg := anArray",
messageSends: [],
referencedClasses: []
}),
smalltalk.DrawedObject.klass);


smalltalk.addClass('Ground', smalltalk.DrawedObject, [], 'Easnoth-Core');
smalltalk.addMethod(
"_drawX_y_",
smalltalk.method({
selector: "drawX:y:",
category: 'displaying',
fn: function (aX, aY) {
    var self = this;
    var ctx = nil;
    ctx = smalltalk.send(self, "_context", []);
    (function ($rec) {smalltalk.send($rec, "_save", []);smalltalk.send($rec, "_translate_y_", [($receiver = aX).klass === smalltalk.Number ? $receiver + 45 : smalltalk.send($receiver, "__plus", [45]), ($receiver = aY).klass === smalltalk.Number ? $receiver - 7 : smalltalk.send($receiver, "__minus", [7])]);smalltalk.send($rec, "_scale_y_", [1, 0.5]);smalltalk.send($rec, "_rotate_", [($receiver = smalltalk.send(smalltalk.Number || Number, "_pi", [])).klass === smalltalk.Number ? $receiver / 4 : smalltalk.send($receiver, "__slash", [4])]);return smalltalk.send($rec, "_scale_y_", [1.4, 1.23]);}(ctx));
    smalltalk.send(self, "_displayX_y_", [0, 0]);
    smalltalk.send(ctx, "_restore", []);
    return self;
},
args: ["aX", "aY"],
source: "drawX: aX y: aY\x0a\x09\x22draw through isometric transformation\x22\x0a\x0a\x09|ctx|\x0a\x09ctx := self context.\x0a\x09ctx save;\x0a\x09\x09translate: aX + 45 y: aY-7;\x0a\x09\x09scale: 1 y: 0.5;\x0a\x09\x09rotate: Number pi / 4 ;\x0a\x09\x09scale: 1.4 y: 1.23.\x0a\x09self displayX: 0 y: 0.\x0a\x09ctx restore.",
messageSends: ["context", "save", "translate:y:", "+", "-", "scale:y:", "rotate:", "/", "pi", "displayX:y:", "restore"],
referencedClasses: ["Number"]
}),
smalltalk.Ground);



smalltalk.addClass('OverTile', smalltalk.Ground, [], 'Easnoth-Core');

smalltalk.addMethod(
"_newWithContext_index_",
smalltalk.method({
selector: "newWithContext:index:",
category: 'instance creation',
fn: function (aContext, anIndex) {
    var self = this;
    return function ($rec) {smalltalk.send($rec, "_initializeContext_index_", [aContext, anIndex]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
    return self;
},
args: ["aContext", "anIndex"],
source: "newWithContext: aContext index: anIndex\x0a\x09^self new\x0a\x09\x09initializeContext: aContext index: anIndex;\x0a\x09\x09yourself.",
messageSends: ["initializeContext:index:", "yourself", "new"],
referencedClasses: []
}),
smalltalk.OverTile.klass);


smalltalk.addClass('Tile', smalltalk.Ground, ['isWall'], 'Easnoth-Core');
smalltalk.addMethod(
"_isWall",
smalltalk.method({
selector: "isWall",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@isWall'];
    return self;
},
args: [],
source: "isWall\x0a\x09^isWall",
messageSends: [],
referencedClasses: []
}),
smalltalk.Tile);

smalltalk.addMethod(
"_isWall_",
smalltalk.method({
selector: "isWall:",
category: 'accessing',
fn: function (aBoolean) {
    var self = this;
    self['@isWall'] = aBoolean;
    return self;
},
args: ["aBoolean"],
source: "isWall: aBoolean\x0a\x09isWall := aBoolean",
messageSends: [],
referencedClasses: []
}),
smalltalk.Tile);


smalltalk.addMethod(
"_newWithContext_index_",
smalltalk.method({
selector: "newWithContext:index:",
category: 'instance creation',
fn: function (aContext, anIndex) {
    var self = this;
    return function ($rec) {smalltalk.send($rec, "_initializeContext_index_", [aContext, anIndex]);smalltalk.send($rec, "_isWall_", [false]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
    return self;
},
args: ["aContext", "anIndex"],
source: "newWithContext: aContext index: anIndex\x0a\x09^self new\x0a\x09\x09initializeContext: aContext index: anIndex;\x0a\x09\x09isWall: false;\x0a\x09\x09yourself.\x0a",
messageSends: ["initializeContext:index:", "isWall:", "yourself", "new"],
referencedClasses: []
}),
smalltalk.Tile.klass);


smalltalk.addClass('OverGround', smalltalk.DrawedObject, ['hp'], 'Easnoth-Core');
smalltalk.addMethod(
"_hp",
smalltalk.method({
selector: "hp",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@hp'];
    return self;
},
args: [],
source: "hp\x0a\x09^hp",
messageSends: [],
referencedClasses: []
}),
smalltalk.OverGround);

smalltalk.addMethod(
"_hp_",
smalltalk.method({
selector: "hp:",
category: 'accessing',
fn: function (aNumber) {
    var self = this;
    self['@hp'] = aNumber;
    return self;
},
args: ["aNumber"],
source: "hp: aNumber\x0a\x09hp := aNumber",
messageSends: [],
referencedClasses: []
}),
smalltalk.OverGround);



smalltalk.addClass('Building', smalltalk.OverGround, [], 'Easnoth-Core');


smalltalk.addClass('Monster', smalltalk.OverGround, [], 'Easnoth-Core');


smalltalk.addClass('Map', smalltalk.Object, ['canvas', 'width', 'height', 'mapX', 'mapY', 'cells'], 'Easnoth-Core');
smalltalk.addMethod(
"_canvas",
smalltalk.method({
selector: "canvas",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@canvas'];
    return self;
},
args: [],
source: "canvas\x0a\x09^canvas",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_canvasId",
smalltalk.method({
selector: "canvasId",
category: 'initialize-release',
fn: function () {
    var self = this;
    return "#main";
    return self;
},
args: [],
source: "canvasId\x0a\x09^'#main'",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_canvasPadding",
smalltalk.method({
selector: "canvasPadding",
category: 'initialize-release',
fn: function () {
    var self = this;
    return 40;
    return self;
},
args: [],
source: "canvasPadding\x0a\x09^40",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_cells",
smalltalk.method({
selector: "cells",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@cells'];
    return self;
},
args: [],
source: "cells\x0a\x09^cells",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_cells_",
smalltalk.method({
selector: "cells:",
category: 'accessing',
fn: function (anArray) {
    var self = this;
    self['@cells'] = anArray;
    return self;
},
args: ["anArray"],
source: "cells: anArray\x0a\x09cells := anArray.",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_height",
smalltalk.method({
selector: "height",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@height'];
    return self;
},
args: [],
source: "height\x0a\x09^height",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_height_",
smalltalk.method({
selector: "height:",
category: 'accessing',
fn: function (aLength) {
    var self = this;
    self['@height'] = aLength;
    return self;
},
args: ["aLength"],
source: "height: aLength\x0a\x09height := aLength",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_initialize",
smalltalk.method({
selector: "initialize",
category: 'initialize-release',
fn: function () {
    var self = this;
    smalltalk.send(self, "_initialize", [], smalltalk.Map.superclass || nil);
    self['@canvas'] = smalltalk.send(smalltalk.TagBrush || TagBrush, "_new", []);
    smalltalk.send(smalltalk.send(self, "_canvas", []), "_initializeFromJQuery_canvas_", [smalltalk.send(smalltalk.send(self, "_canvasId", []), "_asJQuery", []), smalltalk.send(smalltalk.HTMLCanvas || HTMLCanvas, "_onJQuery_", [smalltalk.send("body", "_asJQuery", [])])]);
    return self;
},
args: [],
source: "initialize\x0a\x09super initialize.\x0a\x09canvas := TagBrush new.\x0a\x09self canvas initializeFromJQuery: self canvasId asJQuery canvas: (HTMLCanvas onJQuery: 'body' asJQuery).\x09\x0a",
messageSends: ["initialize", "new", "initializeFromJQuery:canvas:", "canvas", "asJQuery", "canvasId", "onJQuery:"],
referencedClasses: ["TagBrush", "HTMLCanvas"]
}),
smalltalk.Map);

smalltalk.addMethod(
"_initializeCellsWithMapArray_",
smalltalk.method({
selector: "initializeCellsWithMapArray:",
category: 'initialize-release',
fn: function (aMapArray) {
    var self = this;
    var sin45 = nil;
    var sin15 = nil;
    var sin135 = nil;
    var sin75 = nil;
    var cell = nil;
    var xpos = nil;
    var ypos = nil;
    var temp = nil;
    var cood = nil;
    sin45 = 0.707106781;
    sin15 = 0.258819045;
    sin135 = 0.233445364;
    sin75 = 0.965925826;
    smalltalk.send(aMapArray, "_withIndexDo_", [function (row, i) {return smalltalk.send(row, "_withIndexDo_", [function (cellArray, j) {temp = ($receiver = j).klass === smalltalk.Number ? $receiver + smalltalk.send(($receiver = ($receiver = i).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1])).klass === smalltalk.Number ? $receiver / 2 : smalltalk.send($receiver, "__slash", [2]), "_truncated", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(($receiver = ($receiver = i).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1])).klass === smalltalk.Number ? $receiver / 2 : smalltalk.send($receiver, "__slash", [2]), "_truncated", [])]);xpos = ($receiver = ($receiver = ($receiver = ($receiver = i).klass === smalltalk.Number ? $receiver * (($receiver = sin45).klass === smalltalk.Number ? $receiver + sin75 : smalltalk.send($receiver, "__plus", [sin75])) : smalltalk.send($receiver, "__star", [($receiver = sin45).klass === smalltalk.Number ? $receiver + sin75 : smalltalk.send($receiver, "__plus", [sin75])])).klass === smalltalk.Number ? $receiver - (($receiver = temp).klass === smalltalk.Number ? $receiver * (($receiver = sin15).klass === smalltalk.Number ? $receiver + sin75 : smalltalk.send($receiver, "__plus", [sin75])) : smalltalk.send($receiver, "__star", [($receiver = sin15).klass === smalltalk.Number ? $receiver + sin75 : smalltalk.send($receiver, "__plus", [sin75])])) : smalltalk.send($receiver, "__minus", [($receiver = temp).klass === smalltalk.Number ? $receiver * (($receiver = sin15).klass === smalltalk.Number ? $receiver + sin75 : smalltalk.send($receiver, "__plus", [sin75])) : smalltalk.send($receiver, "__star", [($receiver = sin15).klass === smalltalk.Number ? $receiver + sin75 : smalltalk.send($receiver, "__plus", [sin75])])])).klass === smalltalk.Number ? $receiver * smalltalk.send(self, "_tileUnit", []) : smalltalk.send($receiver, "__star", [smalltalk.send(self, "_tileUnit", [])])).klass === smalltalk.Number ? $receiver + smalltalk.send(self, "_mapX", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_mapX", [])]);ypos = ($receiver = ($receiver = ($receiver = ($receiver = ($receiver = temp).klass === smalltalk.Number ? $receiver * (($receiver = sin15).klass === smalltalk.Number ? $receiver + sin75 : smalltalk.send($receiver, "__plus", [sin75])) : smalltalk.send($receiver, "__star", [($receiver = sin15).klass === smalltalk.Number ? $receiver + sin75 : smalltalk.send($receiver, "__plus", [sin75])])).klass === smalltalk.Number ? $receiver / 2 : smalltalk.send($receiver, "__slash", [2])).klass === smalltalk.Number ? $receiver + (($receiver = i).klass === smalltalk.Number ? $receiver * sin135 : smalltalk.send($receiver, "__star", [sin135])) : smalltalk.send($receiver, "__plus", [($receiver = i).klass === smalltalk.Number ? $receiver * sin135 : smalltalk.send($receiver, "__star", [sin135])])).klass === smalltalk.Number ? $receiver * smalltalk.send(self, "_tileUnit", []) : smalltalk.send($receiver, "__star", [smalltalk.send(self, "_tileUnit", [])])).klass === smalltalk.Number ? $receiver + smalltalk.send(self, "_mapY", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_mapY", [])]);cood = smalltalk.send(smalltalk.Array || Array, "_new_", [2]);smalltalk.send(cood, "_at_put_", [1, xpos]);smalltalk.send(cood, "_at_put_", [2, ypos]);return smalltalk.send(smalltalk.send(smalltalk.send(self, "_cells", []), "_at_", [i]), "_at_put_", [j, smalltalk.send(smalltalk.Cell || Cell, "_newWithContext_cellArray_coods_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_canvas", []), "_element", []), "_getContext_", ["2d"]), cellArray, cood])]);}]);}]);
    return self;
},
args: ["aMapArray"],
source: "initializeCellsWithMapArray: aMapArray\x0a\x09\x22TODO put this cste in config file\x22\x0a\x09|sin45 sin15 sin135 sin75 cell xpos ypos temp cood|\x0a\x09sin45 := 0.707106781. \x22Pi/4\x22\x0a\x09sin15 := 0.258819045. \x22Pi/12\x22\x0a\x09sin135 := 0.233445364. \x22???->I used Approximation\x22\x0a\x09sin75 := 0.965925826. \x225*Pi/12\x22\x0a\x09\x0a\x09aMapArray withIndexDo: [:row :i |\x0a\x09\x09row withIndexDo: [ :cellArray :j |\x0a\x09\x09\x09temp := j + ((i + 1)/2) truncated.\x0a\x09\x09\x09xpos := (i * (sin45 + sin75) - (temp* (sin15 + sin75))) * self tileUnit + self mapX.\x0a\x09\x09\x09ypos := (temp * (sin15 + sin75) / 2 + (i * sin135)) * self tileUnit + self mapY.\x0a\x09\x09\x09cood := Array new: 2.\x0a\x09\x09\x09cood at: 1 put: xpos.\x0a\x09\x09\x09cood at: 2 put: ypos.\x0a\x09\x09\x09(self cells at: i) at: j put: (Cell newWithContext: (self canvas element getContext: '2d') cellArray: cellArray coods: cood).\x09\x09\x0a\x09\x09]\x0a\x09]",
messageSends: ["withIndexDo:", "+", "truncated", "/", "*", "-", "tileUnit", "mapX", "mapY", "new:", "at:put:", "at:", "cells", "newWithContext:cellArray:coods:", "getContext:", "element", "canvas"],
referencedClasses: ["Array", "Cell"]
}),
smalltalk.Map);

smalltalk.addMethod(
"_initializeWithMapArray_",
smalltalk.method({
selector: "initializeWithMapArray:",
category: 'initialize-release',
fn: function (aMapArray) {
    var self = this;
    smalltalk.send(self, "_width_", [smalltalk.send(aMapArray, "_size", [])]);
    smalltalk.send(self, "_height_", [smalltalk.send(smalltalk.send(aMapArray, "_at_", [1]), "_size", [])]);
    smalltalk.send(self, "_mapX_", [($receiver = smalltalk.send(self, "_canvasPadding", [])).klass === smalltalk.Number ? $receiver + (($receiver = ($receiver = smalltalk.send(self, "_height", [])).klass === smalltalk.Number ? $receiver * smalltalk.send(self, "_tileUnit", []) : smalltalk.send($receiver, "__star", [smalltalk.send(self, "_tileUnit", [])])).klass === smalltalk.Number ? $receiver * 1.17 : smalltalk.send($receiver, "__star", [1.17])) : smalltalk.send($receiver, "__plus", [($receiver = ($receiver = smalltalk.send(self, "_height", [])).klass === smalltalk.Number ? $receiver * smalltalk.send(self, "_tileUnit", []) : smalltalk.send($receiver, "__star", [smalltalk.send(self, "_tileUnit", [])])).klass === smalltalk.Number ? $receiver * 1.17 : smalltalk.send($receiver, "__star", [1.17])])]);
    smalltalk.send(self, "_mapY_", [smalltalk.send(self, "_canvasPadding", [])]);
    smalltalk.send(self, "_cells_", [smalltalk.send(smalltalk.Array || Array, "_new_", [smalltalk.send(self, "_width", [])])]);
    smalltalk.send(1, "_to_do_", [smalltalk.send(self, "_width", []), function (i) {return smalltalk.send(smalltalk.send(self, "_cells", []), "_at_put_", [i, smalltalk.send(smalltalk.Array || Array, "_new_", [smalltalk.send(self, "_height", [])])]);}]);
    smalltalk.send(self, "_initializeCellsWithMapArray_", [aMapArray]);
    return self;
},
args: ["aMapArray"],
source: "initializeWithMapArray: aMapArray\x0a\x09self width: aMapArray size.\x0a\x09self height: (aMapArray at:1) size.\x0a\x09self mapX: self canvasPadding + (self height * self tileUnit * 1.17).\x0a\x09self mapY: self canvasPadding.\x0a\x09self cells: (Array new: self width).\x0a\x091 to: self width do: [:i | \x0a\x09\x09\x09self cells at: i put: (Array new: self height)].\x0a\x09self initializeCellsWithMapArray: aMapArray.\x0a",
messageSends: ["width:", "size", "height:", "at:", "mapX:", "+", "canvasPadding", "*", "height", "tileUnit", "mapY:", "cells:", "new:", "width", "to:do:", "at:put:", "cells", "initializeCellsWithMapArray:"],
referencedClasses: ["Array"]
}),
smalltalk.Map);

smalltalk.addMethod(
"_mapX",
smalltalk.method({
selector: "mapX",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@mapX'];
    return self;
},
args: [],
source: "mapX\x0a\x09^mapX",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_mapX_",
smalltalk.method({
selector: "mapX:",
category: 'accessing',
fn: function (aLength) {
    var self = this;
    self['@mapX'] = aLength;
    return self;
},
args: ["aLength"],
source: "mapX: aLength\x0a\x09mapX := aLength",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_mapY",
smalltalk.method({
selector: "mapY",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@mapY'];
    return self;
},
args: [],
source: "mapY\x0a\x09^mapY",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_mapY_",
smalltalk.method({
selector: "mapY:",
category: 'accessing',
fn: function (aLength) {
    var self = this;
    self['@mapY'] = aLength;
    return self;
},
args: ["aLength"],
source: "mapY: aLength\x0a\x09mapY := aLength",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_tileUnit",
smalltalk.method({
selector: "tileUnit",
category: 'initialize-release',
fn: function () {
    var self = this;
    return 50;
    return self;
},
args: [],
source: "tileUnit\x0a\x09^50",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_update",
smalltalk.method({
selector: "update",
category: 'displaying',
fn: function () {
    var self = this;
    smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_canvas", []), "_element", []), "_getContext_", ["2d"]), "_clearRect_y_width_height_", [0, 0, 1366, 768]);
    smalltalk.send(smalltalk.send(self, "_cells", []), "_do_", [function (row) {return smalltalk.send(row, "_do_", [function (cell) {return smalltalk.send(cell, "_draw", []);}]);}]);
    return self;
},
args: [],
source: "update\x0a\x09(self canvas element getContext: '2d') clearRect: 0 y: 0 width: 1366 height: 768.\x0a\x09self cells do: [:row |\x0a\x09\x09row do: [ :cell |\x0a\x09\x09\x09cell draw.\x0a\x09\x09]\x0a\x09]",
messageSends: ["clearRect:y:width:height:", "getContext:", "element", "canvas", "do:", "cells", "draw"],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_width",
smalltalk.method({
selector: "width",
category: 'accessing',
fn: function () {
    var self = this;
    return self['@width'];
    return self;
},
args: [],
source: "width\x0a\x09^width",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);

smalltalk.addMethod(
"_width_",
smalltalk.method({
selector: "width:",
category: 'accessing',
fn: function (aLength) {
    var self = this;
    self['@width'] = aLength;
    return self;
},
args: ["aLength"],
source: "width: aLength\x0a\x09width := aLength",
messageSends: [],
referencedClasses: []
}),
smalltalk.Map);


smalltalk.addMethod(
"_newWithMapArray_",
smalltalk.method({
selector: "newWithMapArray:",
category: 'instance creation',
fn: function (aMapArray) {
    var self = this;
    return smalltalk.send(smalltalk.send(self, "_new", []), "_initializeWithMapArray_", [aMapArray]);
    return self;
},
args: ["aMapArray"],
source: "newWithMapArray: aMapArray \x0a\x09^self new initializeWithMapArray: aMapArray",
messageSends: ["initializeWithMapArray:", "new"],
referencedClasses: []
}),
smalltalk.Map.klass);


